<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
    <channel>
        <title>freepost - Latest comments</title>
        <description></description>
        <link>{{ base_url }}</link>
        <lastBuildDate>{{ now () }}</lastBuildDate>
        
        {% for comment in comments %}
            {# freepost URL of this comment #}
            {% set freepost_url = base_url ~ url('post', hash_id=comment.postHashId) ~ '#comment-' ~ comment.hashId %}
            
            <item>
                <guid isPermaLink="false">{{ comment.hashId }}</guid>
                <title>
                    {{ comment.postTitle }}
                </title>
                <description>
                    <![CDATA[
                        <p>{{ comment.text }}</p>
                        <p>{{ comment.vote }} votes</p>
                    ]]>
                </description>
                <link>{{ freepost_url }}</link>
                <freepostLink>{{ freepost_url }}</freepostLink>
                <pubDate>{{ comment.created }}</pubDate>
                <author>{{ comment.username }}</author>
            </item>
        {% endfor %}
    </channel>
</rss>
